<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title></title>
	<script type="text/javascript">
		function as() {
			var radios = document.getElementsByName("gander"); //遍历name为gander的值然后输出
			for (var radio =0; radio < radios.length; radio++) {
				var i = radios[radio];
				alert(i.value);
			} 
		}
	</script>
</head>
<body>
	<input type="radio" name="gander" value="男"/> 男
	<input type="radio" name="gander" value="保密"/> 保密
	<input type="radio" name="gander" value="女"/> 女
	<input type="button" value="选择" onclick="as()"/>
</body>
</html>